ARM_LINUX_XXX=/home/xlbtlmy/Desktop/ARM_Linux/gcc-3.4.5-glibc-2.3.6/bin

CC=$(ARM_LINUX_XXX)/arm-linux-gcc
LD=$(ARM_LINUX_XXX)/arm-linux-ld
OBJCOPY=$(ARM_LINUX_XXX)/arm-linux-objcopy
OBJDUMP=$(ARM_LINUX_XXX)/arm-linux-objdump

TARGET=led_on

	src=$(shell ls *.S)
objs=$(patsubst %.S,%.o,$(src))

BIN=$(TARGET).bin
ELF=$(TARGET).elf
DIS=$(TARGET).dis

$(BIN):$(objs)
	$(LD) -Ttext 0x00000000 $^ -o $(ELF)
	$(OBJCOPY) -O binary -S $(ELF) $(BIN)
	$(OBJDUMP) -D -m arm $(ELF) > $(DIS)

%.o:%.S
	$(CC) -c -o $@ $<

.PHONY:clean
clean:
	rm -f *.o *.bin *.elf *.dis

